/**
 * Copyright (c) 2002-2012 旭鸣信息
 * All rights reserved. 
 * File：FrontGoodsCollectionService.java
 * History: Dec 27, 2012: Initially created, liuzhi.
 */
package com.xteam.ecsystem.service.front;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xteam.ecsystem.dao.IFrontGoodsCollectionDao;
import com.xteam.ecsystem.entities.BaseGoodsCollection;
import com.xteam.ecsystem.utils.PageCenterStation;

/**
 * 前端商品收藏服务层。
 * @author liuzhi
 */
@Service
public class FrontGoodsCollectionService {
	
	@Autowired
	private IFrontGoodsCollectionDao gcDao;
	
	/**
	 * 获得商品收藏分页集合
	 * @author liuzhi Mar 8, 2013
	 * @param bgcMember
	 * @param pageindex
	 * @param pagesize
	 * @return
	 */
	public PageCenterStation<?> getGoodsCollectionList(String bgcMember, int pageIndex, int pageSize){
		return this.gcDao.getGoodsCollectionList(bgcMember, pageIndex, pageSize);
	}
	
	/**
	 * 从收藏列表中删除单个商品
	 * @author liuzhi Mar 11, 2013
	 * @param bmbId
	 * @param goodsId
	 */
	public void delFromFav(String bmbId, String goodsId) {
		this.gcDao.delFromFav(bmbId, goodsId);
	}
	
	/**
	 * 获得用户指定商品的收藏信息
	 * @author liuzhi Apr 27, 2013
	 * @param bmbId
	 * @param goodsId
	 * @return
	 */
	public BaseGoodsCollection getUserFav(String bmbId, String goodsId){
		return this.gcDao.getUserFav(bmbId, goodsId);
	}
	
	/**
	 * 添加商品至搜藏夹
	 * @author liuzhi Apr 27, 2013
	 * @param obj
	 */
	public void saveUserFav(BaseGoodsCollection obj){
		this.gcDao.saveUserFav(obj);
	}
}
